

let animUtils = {

    makeRotateBy(time,angle){
        let r1 = cc.rotateBy(time,angle);
        let r2 = cc.rotateBy(2*time,-angle * 2);
        let r3 = cc.rotateBy(time,angle);
        let seq = cc.sequence(r1,r2,r3);
        let forever = cc.repeatForever(seq);
        forever.setTag(G.Tags.DecoBaseAction);
        return forever;
    },


    makeMoveBy(time,dx,dy){
        let m1 = cc.moveBy(time,dx,dy);
        let m2 = cc.moveBy(2 * time,-dx * 2,-dy * 2);
        let m3 = cc.moveBy(time,dx,dy);
        let seq = cc.sequence(m1,m2,m3);
        let forever = cc.repeatForever(seq);
        forever.setTag(G.Tags.DecoBaseAction);
        return forever;
    },

    makeScaleTo(time,initSx,initSy,sx,sy){
        let zoomIn = cc.scaleTo(time,sx,sy);
        let zoomOut = cc.scaleTo(2 * time,2 * initSx - sx,2 * initSy - sy);
        let z3 = cc.scaleTo(time,initSx,initSy);
        let seq = cc.sequence(zoomIn,zoomOut,z3);
        let forever = cc.repeatForever(seq);
        forever.setTag(G.Tags.DecoBaseAction);
        return forever;
    }

};

module.exports = animUtils;
